package com.example.socialwebserver.controller;

import com.example.socialwebserver.pojo.ActivityClassDAO;
import com.example.socialwebserver.pojo.ServerResult;
import com.example.socialwebserver.service.ActivityClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
public class ActivityClassController {
    @Autowired
    ActivityClassService activityClassService;

    @RequestMapping("/category/selectAll")
    public ServerResult selectAll()
    {
        List<ActivityClassDAO> activityClassDAOS = activityClassService.SelectAll();
        ServerResult serverResult = new ServerResult(0, "活动分类表", activityClassDAOS);
        return serverResult;
    }
}
